package com.example.thirdhomework

import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat

class ThirdActivity : AppCompatActivity() {
    @SuppressLint("MissingInflatedId")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()
        setContentView(R.layout.activity_third)

        val button = findViewById<android.widget.Button>(R.id.button)
        val textView = findViewById<android.widget.TextView>(R.id.editText)
        button.setOnClickListener {
            val intent = Intent()
            intent.putExtra(SECOND_MSG,textView.text.toString())
            setResult(1, intent)
            finish()
        }
    }
}